package com.pin.zheng.xingmulibrary.util;


import java.util.UUID;

public class DeviceUuidFactory {


    protected static final String PREFS_DEVICE_ID = "device_id";
    protected static String uuid;

    public DeviceUuidFactory() {

    }

    public static String getUUID() {
        if (uuid == null || uuid.equals("")) {
            uuid = SpUtil.getInstance().getString(PREFS_DEVICE_ID);
        } else {
            return uuid;
        }


        if (uuid == null || uuid.equals("")) {
            uuid = UUID.randomUUID().toString();
            SpUtil.getInstance().savaString(PREFS_DEVICE_ID, uuid);
        }
        return uuid;
    }
}

